#-*-coding:utf-8-*-
import pymysql
import datetime
from . import setting
class Admin():
    """
    定义的管理员类
    """
    def __init__(self):
        self.name="root"
        self.cursor=None

    def db_connect(self):
        pass

    def verify_passwd(self,_class,id,passwd):

        pass

    def add_stu_info(self,**kwargs):
        pass

    def add_tea_info(self,**kwargs):
        pass

    def set_SCB(self,datatime):#设置开始时间
        pass

    def set_SCE(self,datatime):#设置结束时间
        pass

    def allow_SC(self,if_allow_SC):##设置当前是否允许选课

        setting.ALLOW_SC=if_allow_SC


    def exec_SC(self):##根据每门课按照意愿值大小、课容量与选课时间排序,制成最后的选课结果表
        pass

    def compare_time(time1, time2):
        d1 = datetime.datetime.strptime(time1, '%Y-%m-%d %H:%M:%S')
        d2 = datetime.datetime.strptime(time2, '%Y-%m-%d %H:%M:%S')
        delta = d1 - d2
        print(d1)
        print("seconds is " + str(delta.seconds))
        if delta.seconds >=0:
            return True
        else:
            return False